/*
 * Created on Oct 18, 2004
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package com.erclab.internal.xpresso.reports;

import java.util.*;

import com.erclab.internal.xpresso.Resource;
import com.erclab.internal.xpresso.reportelements.ReportElement;

/**
 * @author rodrigen
 *
 */
public class Report extends Resource {

	protected long idReport;
	protected String reportName;
	protected String query;
	protected int idDatasource;
	protected String title;
	protected String description;
	protected String image;
	protected String uniqueKeyName;
	protected String tableAssociated;
	protected int recordsPerPage;
	protected String sortBy;
	protected String style;
	protected ReportParameters reportParameters;
	protected String viewHandler;
	protected int allowDelete;
	protected int isEditable;
	protected String filterViewHandler;
	protected ArrayList<ReportElement> ReportElements;
	protected ArrayList<ReportFilter> ReportFilters;
	protected ArrayList<ReportView> reportViews;
	protected String reportHelperClass;
	protected ReportHelper reportHelper;
	protected ReportResultSet reportResultSet;

	/**
	 * @return
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @return
	 */
	public long getIdReport() {
		return idReport;
	}

	/**
	 * @return
	 */
	public String getImage() {
		return image;
	}

	/**
	 * @return
	 */
	public int getRecordsPerPage() {
		return recordsPerPage;
	}

	/**
	 * @return
	 */
	public String getReportName() {
		return reportName;
	}

	/**
	 * @return
	 */
	public String getSortBy() {
		return sortBy;
	}

	/**
	 * @return
	 */
	public String getQuery() {
		return query;
	}

	/**
	 * @return
	 */
	public String getTableAssociated() {
		return tableAssociated;
	}

	/**
	 * @return
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @return
	 */
	public String getUniqueKeyName() {
		return uniqueKeyName;
	}

	/**
	 * @param string
	 */
	public void setDescription(String string) {
		description = string;
	}

	/**
	 * @param string
	 */
	public void setIdReport(long i) {
		idReport = i;
	}

	/**
	 * @param string
	 */
	public void setImage(String string) {
		image = string;
	}


	/**
	 * @param i
	 */
	public void setRecordsPerPage(int i) {
		recordsPerPage = i;
	}

	/**
	 * @param string
	 */
	public void setReportName(String string) {
		reportName = string;
	}

	/**
	 * @param string
	 */
	public void setSortBy(String string) {
		sortBy = string;
	}

	/**
	 * @param string
	 */
	public void setQuery(String string) {
		query = string;
	}

	/**
	 * @param string
	 */
	public void setTableAssociated(String string) {
		tableAssociated = string;
	}

	/**
	 * @param string
	 */
	public void setTitle(String string) {
		title = string;
	}

	/**
	 * @param string
	 */
	public void setUniqueKeyName(String string) {
		uniqueKeyName = string;
	}

	/**
	 * @return
	 */
	public ArrayList<ReportElement> getReportElements() {
		return ReportElements;
	}

	/**
	 * @param list
	 */
	public void setReportElements(ArrayList<ReportElement> list) {
		ReportElements = list;
	}

	public String toString() {
		StringBuffer print = new StringBuffer();
		print.append("Report name: " + reportName + "\n");
		print.append("id: " + this.idReport + "\n");
		print.append("title: " + this.title + "\n");
		print.append("description: " + this.description + "\n");		
		print.append("query: " + this.query + "\n");
		print.append("datasourceId: " + this.idDatasource + "\n");
		print.append("category: " + this.category + "\n");
		return print.toString();
	}




	/**
	 * @return
	 */
	public int getIdDatasource() {
		return idDatasource;
	}

	/**
	 * @param i
	 */
	public void setIdDatasource(int i) {
		idDatasource = i;
	}

	/**
	 * @return
	 */
	public String getStyle() {
		return style;
	}

	/**
	 * @param string
	 */
	public void setStyle(String string) {
		style = string;
	}

	/**
	 * @return
	 */
	public ReportParameters getReportParameters() {
		return reportParameters;
	}

	/**
	 * @param parameters
	 */
	public void setReportParameters(ReportParameters reportParameters) {
		this.reportParameters = reportParameters;
	}

	/**
	 * @return
	 */
	public String getViewHandler() {
		return viewHandler;
	}

	/**
	 * @param string
	 */
	public void setViewHandler(String string) {
		viewHandler = string;
	}

	/**
	 * @return
	 */
	public int getAllowDelete() {
		return allowDelete;
	}

	/**
	 * @return
	 */
	public int getIsEditable() {
		return isEditable;
	}

	/**
	 * @param i
	 */
	public void setAllowDelete(int i) {
		allowDelete = i;
	}

	/**
	 * @param i
	 */
	public void setIsEditable(int i) {
		isEditable = i;
	}

	public boolean isDeleteAllowed(){
		return allowDelete==1;
	}

	public boolean isEditable(){
		return isEditable==1;
	}

	/**
	 * @return
	 */
	public ArrayList<ReportFilter> getReportFilters() {
		return ReportFilters;
	}

	/**
	 * @param list
	 */
	public void setReportFilters(ArrayList<ReportFilter> list) {
		ReportFilters = list;
	}


	/**
	 * @return
	 */
	public String getFilterViewHandler() {
		return filterViewHandler;
	}

	/**
	 * @param string
	 */
	public void setFilterViewHandler(String string) {
		filterViewHandler = string;
	}

	public ReportHelper getReportHelper() {
		return reportHelper;
	}

	public void setReportHelper(ReportHelper reportHelper) {
		this.reportHelper = reportHelper;
	}

	public String getReportHelperClass() {
		return reportHelperClass;
	}

	public void setReportHelperClass(String reportHelperClass) {
		this.reportHelperClass = reportHelperClass;
	}

	public ReportResultSet getReportResultSet() {
		return reportResultSet;
	}

	public void setReportResultSet(ReportResultSet reportResultSet) {
		this.reportResultSet = reportResultSet;
	}

	public ArrayList<ReportView> getReportViews() {
		return reportViews;
	}

	public void setReportViews(ArrayList<ReportView> reportViews) {
		this.reportViews = reportViews;
	}

}
